package com.example.village.service.impl;

import com.example.village.dao.PayDao;
import com.example.village.entity.PayEntity;
import com.example.village.entityVO.PayDimVO;
import com.example.village.entityVO.PayVO;
import com.example.village.service.PayService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class PayServiceImpl implements PayService {

    @Autowired
    private PayDao payDao;

    @Override
    public List<PayVO> queryByDim(PayDimVO payDimVO) {
        return payDao.queryByDim(payDimVO);
    }

    @Override
    public List<PayEntity> queryDimByUid(PayDimVO payDimVO) {
        return payDao.queryDimByUid(payDimVO);
    }

    @Override
    public Boolean insert(PayEntity payEntity) {
        return payDao.insert(payEntity) > 0;
    }

    @Override
    public Boolean update(PayEntity payEntity) {
        return payDao.update(payEntity) > 0;
    }

    @Override
    public Boolean delete(int id) {
        return payDao.delete(id) > 0;
    }

    @Override
    public Boolean deleteMore(List<Integer> ids) {
        if (payDao.deleteMore(ids) > 0) {
            return true;
        }
        return false;
    }
}
